<template>
  <div class="questions-check">
    <el-form ref="form">
      <el-radio-group v-model="chkState">
        <el-radio :label="1">通过</el-radio>
        <el-radio :label="2">拒绝</el-radio>
      </el-radio-group>
      <el-form-item>
        <el-input type="textarea" placeholder="请输入审核意见" v-model.trim="message"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button size="medium">取消</el-button>
        <el-button type="primary" @click="ReviewonSubmit" size="medium" :disabled="!message.length">确认</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { choiceCheck } from '@/api/hmmm/questions'
export default {
  name: 'QuestionsCheck',
  components: {},
  props: {
    id: {
      type: [Number, String, Object],
      required: true
    }
  },
  data () {
    return {
      message: '',
      chkState: 1
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    async ReviewonSubmit () {
      try {
        const { data } = await choiceCheck({
          id: this.id,
          chkState: this.chkState,
          chkRemarks: this.message
        })
        this.$emit('CloseReviewbtn', data)
        this.$message({
          showClose: true,
          message: '操作成功！',
          type: 'success'
        })
      } catch (err) {
        console.log('请求失败', err)
      }
    }
  }
}
</script>

<style scoped lang='scss'>
.el-radio-group {
  display: flex;
  flex-direction: row;
  justify-content: start;
  .el-radio {
    margin-bottom: 20px;
  }
}
</style>
